package com.woniuxy.controller;

import com.woniuxy.entity.PageEntity;
import com.woniuxy.entity.PageEntity01;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.entity.UpRoleDTO;
import com.woniuxy.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO: 对于角色的操作
 * <P> Date: 2022/2/24:21:34
 * <P> Description:
 */
@RequestMapping("/role")
@RestController
public class RoleController {
    @Autowired
    RoleService roleService;

    @RequestMapping("/findAll")
    public ResponseEntity findAll(@RequestBody PageEntity01 pageEntity){
        return  roleService.findAll(pageEntity);
    }

    @RequestMapping("/updateRole")
    public ResponseEntity updateRole(@RequestBody UpRoleDTO upRoleDTO){
        return  roleService.updateRole(upRoleDTO);
    }
    @GetMapping("/findRole/{rowId}")
    public ResponseEntity findRole(@PathVariable Integer rowId){

        return  roleService.findRole(rowId);
    }
}
